package com.v.im.businessservice.bean;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

public class ImChatGroupUserEntityPK implements Serializable {
    private String chatGroupId;
    private String userId;

    @Column(name = "chat_group_id")
    @Id
    public String getChatGroupId() {
        return chatGroupId;
    }

    public void setChatGroupId(String chatGroupId) {
        this.chatGroupId = chatGroupId;
    }

    @Column(name = "user_id")
    @Id
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ImChatGroupUserEntityPK that = (ImChatGroupUserEntityPK) o;
        return Objects.equals(chatGroupId, that.chatGroupId) &&
                Objects.equals(userId, that.userId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(chatGroupId, userId);
    }
}
